
<?php if ($mode== "ADD"){?>
<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> ASSOCIATION MANAGEMENT </header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="news" method="POST"
				action="<?= base_url();?>secure/listing/listings/submit_association/<?= $profile_id;?>">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Position</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('position'); ?></span>
						<input type="text" class="form-control" id="position" name="position"
							placeholder="Position">
					</div>
				</div>


				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Association</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('association'); ?></span>
						<input type="text" class="form-control" id="association" name="association"
							placeholder="Association">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">From Year</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('from_year'); ?></span>
						<input type="text" class="form-control" id="from_year" name="from_year"
							placeholder="From Year">
					</div>
				</div>
				
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">To Year</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('to_year'); ?></span>
						<input type="text" class="form-control" id="to_year" name="to_year"
							placeholder="To Year">
					</div>
				</div>

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-4">
					<input type="hidden" name="profile_id" value="<?= $profile_id?>">
					
						<input type="submit" class="btn btn-info pull-right" value="Add Association"  <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	
	<section class="panel">
					<header class="panel-heading"> ASSOCIATION MANAGEMENT   </header>
					<div class="panel-body">
						<table class="table table-striped table-advance table-hover">
							<thead>
								<tr>
									<th><i class="icon-bullhorn"></i> Position</th>
									<th class="hidden-phone "><i class="icon-bookmark"></i>
										Association</th>
									<th><i class="icon-bookmark"></i> From Year</th>
									<th><i class="icon-bookmark"></i> To Year</th>
									<th><i class=" icon-edit"></i> Action</th>
								</tr>
							</thead>
							<tbody>
							<?php if($association){?>
							<?php foreach($association as $association):?>
								<tr>
									<th><?= $association->position;?></th>
									<td class="hidden-phone"><?= $association->association;?></td>
									<td><?= $association->year_from;?></td>
									<td><?= $association->year_to;?></td>
									<td>
									
									
										<a href="<?= base_url();?>secure/listing/listings/edit_association/<?= $association->id; ?>" data-toggle="tooltip" title="Edit" onclick="return confirm('Are you sure you want to Edit?')">
										<button class="btn btn-primary btn-xs">
											<i class="icon-pencil"></i>
										</button>
										</a>
										<a href="<?= base_url();?>secure/listing/listings/delete_association/<?= $association->id;?>" <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  data-toggle="tooltip" title="Delete">
										<button class="btn btn-danger btn-xs">
											<i class="icon-trash "></i>
										</button>
										</a>
									</td>
								</tr>
								
								<?php endforeach;}?>
							</tbody>
						</table>

						<!-- End of Body Panel -->
				</section>
	<!-- page end-->
</section>
<?php }?>
<?php if($mode== "EDIT"){?>

<section class="wrapper">
	<!-- page start-->
	<section class="panel">
		<header class="panel-heading"> ASSOCIATION MANAGEMENT <span class="pull-right"><a href="<?= base_url();?>secure/listing/listings/add_association/<?= $association['info']->profile_id;?>" type="button" class="btn btn-success btn-sm">Back</a></span></header>
		<div class="panel-body">
			<form class="form-horizontal" role="form" name="news" method="POST"
				action="<?= base_url();?>secure/listing/listings/update_association">
				<?php
				$this->session->flashdata('message'); {
					$msg = $this->session->flashdata('message');
					echo '<font color="red">' . $msg . '</font>';
				}
				?>
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Position</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('position'); ?></span>
						<input type="text" class="form-control" id="position" name="position"
							placeholder="Position" value="<?= $association['info']->position;?>">
					</div>
				</div>


				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">Association</label>
					<div class="col-lg-4">
					<span class="text text-danger">
							<?php echo form_error('association'); ?></span>
						<input type="text" class="form-control" id="association" name="association"
							placeholder="Association" value="<?= $association['info']->association;?>">
					</div>
				</div>

				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">From Year</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('from_year'); ?></span>
						<input type="text" class="form-control" id="from_year" name="from_year"
							placeholder="From Year" value="<?= $association['info']->year_from;?>">
					</div>
				</div>
				
				<div class="form-group">
					<label for="input" class="col-lg-2 control-label">To Year</label>
					<div class="col-lg-2">
					<span class="text text-danger">
							<?php echo form_error('to_year'); ?></span>
						<input type="text" class="form-control" id="to_year" name="to_year"
							placeholder="To Year" value="<?= $association['info']->year_to;?>">
					</div>
				</div>

				<div class="form-group">
					<div class="col-lg-offset-2 col-lg-4">
					<input type="hidden" name="id" value="<?= $association['info']->id;?>">
					<input type="submit" class="btn btn-info pull-right" value="Update"  <?php if($this->config->item('mode')=='DEMO'){?>onclick="alert ('Sorry! Not allowed in demo mode '); return false;" <?} else?>onclick="return confirm('Are you sure ?');"  >
					</div>
				</div>


			</form>
		</div>
		<!-- End of Body Panel -->
	</section>
	</section>



<?php }?>